package com.wc.blue_bridge_test.base.T56;

import java.util.Locale;
import java.util.Scanner;

/**
 * @Author congge
 * @Date 2023/12/29 11:15
 * @description
 * 字符串对比
 * https://lx.lanqiao.cn/problem.page?gpid=T56
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s1 = sc.nextLine();
        String s2 = sc.nextLine();

        if (s1.length() != s2.length()) {
            System.out.println(1);
        } else {
            if (s1.equals(s2)) {
                System.out.println(2);
            } else if (s1.toUpperCase(Locale.ROOT).equals(s2.toUpperCase(Locale.ROOT))) {
                System.out.println(3);
            } else {
                System.out.println(4);
            }
        }
    }
}
